import 'package:flutter/material.dart';
import 'package:flutter_app/containerWidgets/PaddingTestRoute.dart';
import 'ConstrainedBoxAndSizedBoxTestRoute.dart';
import 'TransformTestRoute.dart';
import 'ContainerTestRoute.dart';
import 'ScaffoldTestRoute.dart';

class ContainerWidgetsTestRoute extends StatefulWidget {
  @override
  _ContainerWidgetsTestRouteState createState() =>
      new _ContainerWidgetsTestRouteState();
}

class _ContainerWidgetsTestRouteState
    extends State<ContainerWidgetsTestRoute> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('容器类Widgets'),
      ),
      body: ConstrainedBox(
        constraints: BoxConstraints.expand(),
        child: Stack(
          alignment: Alignment.center,
          children: <Widget>[
            Positioned(
              left: 10.0,
              child: RaisedButton(
                child: Text('Padding'),
                onPressed: () {
                  Navigator.push(context,
                      new MaterialPageRoute(builder: (context) {
                    return new PaddingTestRoute();
                  }));
                },
              ),
            ),
            Positioned(
              top: 20.0,
              child: RaisedButton(
                child: Text('ConstrainedBox、SizedBox、DecoratedBox'),
                onPressed: () {
                  Navigator.push(context,
                      new MaterialPageRoute(builder: (context) {
                    return new ConstrainedBoxAndSizedBoxTestRoute();
                  }));
                },
              ),
            ),
            Positioned(
              bottom: 20.0,
              child: RaisedButton(
                child: Text('Transform'),
                onPressed: () {
                  Navigator.push(context,
                      new MaterialPageRoute(builder: (context) {
                    return new TransformTestRoute();
                  }));
                },
              ),
            ),
            Positioned(
              right: 20.0,
              child: RaisedButton(
                child: Text('Container'),
                onPressed: () {
                  Navigator.push(context,
                      new MaterialPageRoute(builder: (context) {
                    return new ContainerTestRoute();
                  }));
                },
              ),
            ),
            Positioned(
              top: 100.0,
              child: RaisedButton(
                child: Text('Scaffold、TabBar、底部导航'),
                onPressed: () {
                  Navigator.push(context,
                      new MaterialPageRoute(builder: (context) {
                    return new ScaffoldTestRoute();
                  }));
                },
              ),
            )
          ],
        ),
      ),
    );
  }
}
